# _*_ coding : utf-8 _*_
# @Time : 2023/12/12 10:31
# @Author : 韩宗森
# @File : 29_requests_post
# @Project : pythonProject


import requests
import json

url = 'https://fanyi.baidu.com/v2transapi'

data = {
    'from': 'en',
    'to': 'zh',
    'query': 'eye',
    'transtype':'realtime',
    'simple_means_flag':3,
    'token':'094807290fe2fd41b1ea23d0f41c6502'
}

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
}

# data请求参数  kwargs字典
response = requests.post(url=url, data=data, headers=headers)

content = response.text
# print(content)

obj = json.loads(s=content)

print(obj)
